package com.itheima.demo01.Map;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Demo03EntrySet {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();
        map.put("黄晓明", "杨颖");
        map.put("冷锋", "龙小云");
        map.put("杨过", "小龙女");
        Set<Map.Entry<String, String>> set = map.entrySet();
        Iterator<Map.Entry<String, String>> it = set.iterator();
        while (it.hasNext()) {
            Map.Entry<String, String> i = it.next();
            String key = i.getKey();
            String value = i.getValue();
            System.out.println(key + ":" + value);
        }
    }
}
